import WebStorageCache from './web-storage-cache'

const WebStorageCacheInstance = (opts) => {
    return new WebStorageCache(opts);
};

const localStorage = WebStorageCacheInstance({storage: "localStorage"});
const sessionStorage = WebStorageCacheInstance({storage: "sessionStorage"});
export default {
    setLocal(key, val) {
        localStorage.set(key, val);
    },
    getLocal(key) {
        return localStorage.get(key);
    },
    deleteLocal(key) {
        localStorage.delete(key);
    },
    setSession(key, val) {
        sessionStorage.set(key, val);
    },
    getSession(key) {
        return sessionStorage.get(key);
    },
    deleteSession(key) {
        sessionStorage.delete('key');
    }

}

